//
//  APIOneRank.m
//  Bracelet
//
//  Created by jing zhao on 2/16/15.
//  Copyright (c) 2015 jing zhao. All rights reserved.
//

#import "APIOneRank.h"

@implementation APIPaper

-(instancetype) initFromDictionaryPaper:(NSDictionary*)dic
{
    self = [super init];
    if (self) {
        self.pageNo = [[dic objectForKey:APIKEYPAGENO]intValue];
        self.pageSize = [[dic objectForKey:APIKEYPAGESIZE]intValue];
        self.startRow = [[dic objectForKey:APIKEYSTARTROW]intValue];
        self.totalPages = [[dic objectForKey:APIKEYTOTALPAGES]intValue];
        self.totalRows = [[dic objectForKey:APIKEYTOTALROWS]intValue];
    }
    return self;
}
+(instancetype)apiFromDictionaryPaper:(NSDictionary*)dic
{
    return [[self alloc]initFromDictionaryPaper:dic];
}


@end
@implementation APIOneRank

-(instancetype) initFromDictionaryRankOnePeople:(NSDictionary*)dic
{
    self = [super init];
    if (self) {
        self.rankNumber = [[dic objectForKey:APIKEYRANKNUM]integerValue];
        self.totalRunMetres = [dic objectForKey:APIKEYTOTALRUNMETRES];
        self.userId = [dic objectForKey:APIKEYUSERID];
        self.userName = [dic objectForKey:APIKEYUSERNAME];
        
    }
    return self;
}
+(instancetype)apiFromDictionaryRankOnePeople:(NSDictionary*)dic
{
    return [[self alloc]initFromDictionaryRankOnePeople:dic];
}

@end
